<?php

if (!defined('BASEPATH'))
	exit('No direct script access allowed');
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of GON_public
 *
 * @author Mahar<mahardiansyahkartika@gmail.com>
 * @property Flash_message $flash_message
 */
class GON_User extends CI_Controller {

	public function __construct() {
		parent::__construct();
		$this->__check_login();
	}

	function __declare_view($data = NULL, $view_name = NULL) {
		$out['title'] = $data['title'];
		$out['id'] = $data['id'];
		$out['type'] = $data['type'];
		$this->load->view("template/head", $out);
		$this->load->view($view_name, $data);
		$this->load->view("template/footer");
	}

	public function __check_login() {
		//check login
		if (!$this->session->userdata('logged_in')) {
			$this->flash_message->error('Silahkan login untuk menggunakan aplikasi ini');
			redirect('login');
		}
	}

}

/* End of class GON_public */